package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerMailGiftLog implements IQLResponse
{
    /// <summary>
    /// 赠送者玩家Id
    /// </summary>
    public long SenderUserId;

    /// <summary>
    /// 赠送者昵称
    /// </summary>
    public String SenderNickname;

    /// <summary>
    /// 赠送者商人标记
    /// </summary>
    public long SenderBusinessman;

    /// <summary>
    /// 接收者玩家Id
    /// </summary>
    public long ReceiverUserId;

    /// <summary>
    /// 接收者昵称
    /// </summary>
    public String ReceiverNickname;

    /// <summary>
    /// 接收者商人标记
    /// </summary>
    public long ReceiverBusinessman;

    /// <summary>
    /// 赠送物品Id
    /// </summary>
    public long ItemId;

    /// <summary>
    /// 赠送物品子Id
    /// </summary>
    public long ItemSubId;

    /// <summary>
    /// 赠送前的数量
    /// </summary>
    public long OriginCount;

    /// <summary>
    /// 赠送数量
    /// </summary>
    public long Delta;

    /// <summary>
    /// 赠送时间
    /// </summary>
    public String CreateTime;

    /// <summary>
    /// 物品名称
    /// </summary>
    public String ItemName;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("sender_user_id"))
            SenderUserId = t.getLong("sender_user_id");
        if (t.has("sender_nickname"))
            SenderNickname = t.getString("sender_nickname");
        if (t.has("sender_businessman"))
            SenderBusinessman = t.getLong("sender_businessman");
        if (t.has("receiver_user_id"))
            ReceiverUserId = t.getLong("receiver_user_id");
        if (t.has("receiver_nickname"))
            ReceiverNickname = t.getString("receiver_nickname");
        if (t.has("receiver_businessman"))
            ReceiverBusinessman = t.getLong("receiver_businessman");
        if (t.has("item_id"))
            ItemId = t.getLong("item_id");
        if (t.has("item_sub_id"))
            ItemSubId = t.getLong("item_sub_id");
        if (t.has("origin_count"))
            OriginCount = t.getLong("origin_count");
        if (t.has("delta"))
            Delta = t.getLong("delta");
        if (t.has("create_time"))
            CreateTime = t.getString("create_time");
        if (t.has("item_name"))
            ItemName = t.getString("item_name");
    }
}
